﻿<%@ Page Title="" Language="C#" MasterPageFile="~/toolbox.master" AutoEventWireup="true" CodeFile="propertylist.aspx.cs" Inherits="propertylist" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadPlaceHolder1" Runat="Server">
    <script type="text/javascript">
        $(document).ready(function() {
            $("dilistv.no").add("div.list_saved").live('click', function() {

                var id = $(this).closest("div").attr("id");
                $("#task_num").attr("value", id);
                $("#form2").get(0).setAttribute("action", "shoppingcart.aspx");
                $("#form2").submit();
                return false;
            });

            $('div.list_saved').click(function() {
                var id = $(this).closest("div").attr("id");
                $("#task_num").attr("value", id);
                $("#form2").get(0).setAttribute("action", "shoppingcart.aspx");
                $("#form2").submit();
                return false;
            });

            $("div.nolist").live('click', function() {
                var id = $(this).closest("div").attr("id");
                $("#task_num").attr("value", id);
                $("#form2").get(0).setAttribute("action", "shoppingcart.aspx");
                $("#form2").submit();
                return false;
            });

            $("div.ordered").live('click', function() {
                var id = $(this).closest("div").attr("id");
                $("#task_num").attr("value", id);
                $("#form2").get(0).setAttribute("action", "orders.aspx");
                $("#form2").submit();
                return false;
            });

            $("div.artwork").live('click', function() {
                var id = $(this).closest("p").attr("id");
                $("#task_num").attr("value", id);
                $("#form2").get(0).setAttribute("action", "artwork.aspx");
                $("#form2").submit();
                return false;
            });

            $("p.propertyInfo").live('click', function() {
                var id = $(this).closest("div").attr("id");

                $("#task_num").attr("value", id);
                $("#form2").get(0).setAttribute("action", "property.aspx");
                $("#form2").submit();
                return false;
            });
        });	
    </script>
    
    <style type="text/css">
         div.list_saved, div.nolist, div.ordered
        {
            width:30px;
		    cursor:pointer;
            cursor:hand;	   
            height:100%;        
        }
    
        div.nolist{
            background: url(images/buy.gif) no-repeat;	
        }
    
        div.list_saved
        {
		    background: url(images/list_saved.gif) no-repeat;	
        }
        
        div.ordered
        {
            background: url(images/list_saved.gif) no-repeat;
        }    
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <form id="form1" method="post" runat="server"> 
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>    
    <asp:Label ID="lblmsg" runat="server" ForeColor="Red" Font-Bold="true" Font-Names="verdana" Font-Size="9"></asp:Label>   

        <div class="floatleft" style="border: 1px solid #333; color:White; margin-top: 5px;">
            <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                <ContentTemplate>
                    <asp:GridView ID="gvpropertylist" runat="server" ShowFooter="true" ShowHeader="true"
                        AutoGenerateColumns="false" GridLines="None" 
                        onrowdatabound="gvpropertylist_RowDataBound"
                        onpageindexchanging="gvpropertylist_PageIndexChanging" AllowPaging="true" 
                        PageSize="10" onrowcommand="gvpropertylist_RowCommand" 
                        onrowcreated="gvpropertylist_RowCreated" >                    
                        <Columns>
                            <asp:TemplateField ItemStyle-CssClass="manageboxGd" FooterStyle-CssClass="manageboxGd">
                                <HeaderTemplate>
                                    <div class="tbltitile">                
                                        <table width="100%" border="0" align="left" cellpadding="0" cellspacing="0">
                                            <tr>
                                               <td width="6%" align="center" valign="middle">
                                                    <%--<a href="">Status</a>--%>
                                                    Status
                                                </td>
                                                <td width="8%" align="center" class="idpnd5right">
                                                <%--<a href="">Artwork</a>--%>
                                                    Artwork
                                                </td>
                                                 <td width="4%" align="center" class="idpnd5right">
                                                <%--<a href="">Artwork</a>--%>
                                                    Edit
                                                </td>
                                                <td width="6%" align="center" class="idpnd5right">
                                                    <%--<a href="">ID</a>--%>
                                                    ID                                                
                                                </td>
                                                <td width="30%" align="left" valign="middle" class="idpnd5">
                                                    <%--<a href="">Property Details </a>--%>
                                                    Property Details
                                                    <asp:ImageButton ID="ImageButton1" runat="server" CommandName="Sort" CommandArgument="property_id" />
                                                </td>
                                                <td width="10%" align="left" valign="middle">
                                                    <%--<a href="">Campaign</a>--%>
                                                    Campaign
                                                    
                                                </td>
                                                <td width="9%" align="left" valign="middle">
                                                    <%--<a href="">Created</a>--%>
                                                    Created
                                                    <asp:ImageButton ID="ImageButton2" runat="server" CommandName="Sort" CommandArgument="created_date" />
                                                </td>
                                                <td width="15%" align="left" valign="middle">
                                                    <%--<a href="">Last Modified</a>--%>
                                                    Last Modified
                                                    <asp:ImageButton ID="ImageButton3" runat="server" CommandName="Sort" CommandArgument="last_modified_date" />
                                                </td>
                                                <td width="14%" align="left" valign="middle">
                                                    <%--<a href="">Sale Method</a>--%>
                                                    Sale Method
                                                </td>
                                            </tr>
                                        </table>
                                    </div>                                
                                </HeaderTemplate>
                                <ItemTemplate>                                                          
                                        <table border="0" cellspacing="0" cellpadding="0" style="width: 100%; height:100%;">
                                            <tr >
                                                <td width="6%" align="center" valign="middle"  id="imagediv" runat="server">
                                                </td>
                                                <td width="8%" align="center" class="idpnd5right">
                                                    <a href='artwork.aspx?property_id=<%# Eval("property_id")%>'>
                                                        <img src="images/art.gif" alt="" title="" />
                                                    </a>
                                                </td>
                                                 <td width="4%" align="center" class="idpnd5right">
                                                    <div id='<%# Eval("property_id")%>'>
                                                        <p class='propertyInfo'>
                                                            <a href='#'><img src="images/edit.png" alt="" title="" /></a>
                                                        </p>
                                                    </div>
                                                </td>
                                                <td width="6%" align="center" class="idpnd5right">
                                                    <%# Container.DataItemIndex + 1 %>
                                                </td>
                                                <td width="30%" class="idpnd5">
                                                    <div id='<%# Eval("property_id")%>'>
                                                        <p class='propertyInfo'>
                                                            <a href='#'>
                                                                <%# Eval("address1")%> <%# Eval("address2")%> <%# Eval("suburb")%> <%# Eval("state")%>
                                                            </a>
                                                        </p> 
                                                    </div>   
                                                </td>
                                                <td width="10%">
                                                    <asp:Label ID="statusLabel" runat="server"></asp:Label>
                                                </td>
                                                <td width="10%">
                                                    <asp:Label ID="createdate" runat="server"></asp:Label>
                                                </td>
                                                <td width="15%">
                                                    <asp:Label ID="modifieddate" runat="server"></asp:Label>
                                                </td>
                                                <td width="14%">
                                                    <asp:Label ID="vStatus" runat="server"></asp:Label>
                                                </td>
                                            </tr>
                                        </table>
                                </ItemTemplate>
                                <FooterTemplate>
                                    <table width="100%">
                                        <tr>
                                            <td style="width: 30%;">
                                                <asp:Label ID="footercount" Font-Bold="true" runat="server"></asp:Label>
                                            </td>
                                            <td style="width: 30%;" align="right">
                                                <asp:Label ID="Label1" runat="server" Font-Bold="true" Text="Show rows:&nbsp;&nbsp;&nbsp;"></asp:Label>
                                            </td>
                                            <td style="width: 30%;" align="left">
                                                <asp:DropDownList ID="ddlPage" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlPage_SelectedIndexChanged">
                                                </asp:DropDownList>
                                            </td>
                                            <td style="width: 10%;">
                                                <asp:Label ID="Label2" runat="server" Font-Bold="true"></asp:Label>
                                            </td>
                                        </tr>
                                    </table>                                    
                                </FooterTemplate>
                            </asp:TemplateField>
                        </Columns>
                    </asp:GridView>
                </ContentTemplate>
            </asp:UpdatePanel>
        </div>
    
    </form>
    <form id="form2" name="form2" method="post">
        <input type="hidden" name="task_num" id="task_num" />
    </form>
</asp:Content>

